﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for RandomPasswordGenerator
/// </summary>
public class RandomPasswordGenerator
{
	public RandomPasswordGenerator()
	{
		//
		// TODO: Add constructor logic here

		//
	}

    public string CreateRandomPassword (int passwordLength)
    {
        string allowedChars = "abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789!@$?_-";
        char[] chars = new char[passwordLength];
        Random rd = new Random();

        for (int i = 0; i < passwordLength; i++)
        {
            chars[i] = allowedChars[rd.Next(0, allowedChars.Length)];
        }

        return new string (chars);
    }
    


}